import 'package:flutter/material.dart';
import 'package:flutter_demo/placeholder_widget/BigPic.dart';
import 'package:flutter_demo/placeholder_widget/ListPage.dart';
import 'package:flutter_demo/placeholder_widget/Setting.dart';
class BottomTab_Widget extends StatefulWidget {
  const BottomTab_Widget({Key? key}) : super(key: key);

  @override
  _StartWidgetState createState() => _StartWidgetState();
}

class _StartWidgetState extends State<BottomTab_Widget> {
  int _currentIndex = 0;
  List<Widget> _list_widget=[
   ListPage(),
    BigPic(),
    Setting()
  ];
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home:  Scaffold(
      appBar: AppBar(
        title: Text("BottomTab"),
        backgroundColor: Colors.black45,
      ),
      body: _list_widget[_currentIndex],
      bottomNavigationBar: BottomNavigationBar(
        onTap: (index) {
          print(index);
          setState(() {
            _currentIndex = index;
          });
        },
        currentIndex: _currentIndex,
        items: <BottomNavigationBarItem>[
          BottomNavigationBarItem(icon: Icon(Icons.home), label: "首页"),
          BottomNavigationBarItem(
              icon: Icon(Icons.business_center), label: "大图"),
          BottomNavigationBarItem(icon: Icon(Icons.settings), label: "我的"),
        ],
      ),
    ));
  }
}
